<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <link rel="icon" sizes="any" mask="" href="../static/img/boxicon.png">


    <title>Depot仓储管理系统 | 数据分析</title>
    <meta content="Depot仓储管理系统 数据分析" name="description">
    <meta content="Depot仓储管理系统 数据分析" name="keywords">


    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <!-- Font Awesome -->
    <!-- Ionicons -->
    <!-- iCheck -->
    <!-- Morris chart -->
    <!-- jvectormap -->
    <!-- Date Picker -->
    <!-- Daterange picker -->
    <!-- Bootstrap time Picker -->
    <!--<link rel="stylesheet" href="../static/plugins/timepicker/bootstrap-timepicker.min.css">-->
    <!-- bootstrap wysihtml5 - text editor -->
    <!--数据表格-->
    <!-- 表格树 -->
    <!-- select2 -->
    <!-- Bootstrap Color Picker -->
    <!-- bootstrap wysihtml5 - text editor -->
    <!--bootstrap-markdown-->
    <!-- Theme style -->
    <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
    <!-- Ion Slider -->
    <!-- ion slider Nice -->
    <!-- bootstrap slider -->
    <!-- bootstrap-datetimepicker -->

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->


    <!-- jQuery 2.2.3 -->
    <!-- jQuery UI 1.11.4 -->
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <!-- Bootstrap 3.3.6 -->
    <!-- Morris.js charts -->
    <!-- Sparkline -->
    <!-- jvectormap -->
    <!-- jQuery Knob Chart -->
    <!-- daterangepicker -->
    <!-- datepicker -->
    <!-- Bootstrap WYSIHTML5 -->
    <!-- Slimscroll -->
    <!-- FastClick -->
    <!-- iCheck -->
    <!-- AdminLTE App -->
    <!-- 表格树 -->
    <!-- select2 -->
    <!-- bootstrap color picker -->
    <!-- bootstrap time picker -->
    <!--<script src="../static/plugins/timepicker/bootstrap-timepicker.min.js"></script>-->
    <!-- Bootstrap WYSIHTML5 -->
    <!--bootstrap-markdown-->
    <!-- CK Editor -->
    <!-- InputMask -->
    <!-- DataTables -->
    <!-- ChartJS 1.0.1 -->
    <!-- FLOT CHARTS -->
    <!-- FLOT RESIZE PLUGIN - allows the chart to redraw when the window is resized -->
    <!-- FLOT PIE PLUGIN - also used to draw donut charts -->
    <!-- FLOT CATEGORIES PLUGIN - Used to draw bar charts -->
    <!-- jQuery Knob -->
    <!-- Sparkline -->
    <!-- Morris.js charts -->
    <!-- Ion Slider -->
    <!-- Bootstrap slider -->
    <!-- bootstrap-datetimepicker -->
    <!-- 页面meta /-->
    <link href="../static/plugins/video/video.css" rel="stylesheet" type="text/css">
    <link href="../static/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="../static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="../static/plugins/ionicons/css/ionicons.min.css" rel="stylesheet">
    <link href="../static/plugins/iCheck/square/blue.css" rel="stylesheet">
    <link href="../static/plugins/morris/morris.css" rel="stylesheet">
    <link href="../static/plugins/jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet">
    <link href="../static/plugins/datepicker/datepicker3.css" rel="stylesheet">
    <link href="../static/plugins/daterangepicker/daterangepicker.css" rel="stylesheet">
    <link href="../static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet">
    <link href="../static/plugins/datatables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="../static/plugins/treeTable/jquery.treetable.css" rel="stylesheet">
    <link href="../static/plugins/treeTable/jquery.treetable.theme.default.css" rel="stylesheet">
    <link href="../static/plugins/select2/select2.css" rel="stylesheet">
    <link href="../static/plugins/colorpicker/bootstrap-colorpicker.min.css" rel="stylesheet">
    <link href="../static/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css" rel="stylesheet">
    <link href="../static/plugins/adminLTE/css/AdminLTE.css" rel="stylesheet">
    <link href="../static/plugins/adminLTE/css/skins/_all-skins.min.css" rel="stylesheet">
    <link href="../static/css/style.css" rel="stylesheet">
    <link href="../static/plugins/ionslider/ion.rangeSlider.css" rel="stylesheet">
    <link href="../static/plugins/ionslider/ion.rangeSlider.skinNice.css" rel="stylesheet">
    <link href="../static/plugins/bootstrap-slider/slider.css" rel="stylesheet">
    <link href="../static/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.css" rel="stylesheet">
</head>

<body class="hold-transition skin-purple sidebar-mini">

<div class="wrapper">
    <!-- 页面头部 -->
    <header class="main-header">


        <!-- Logo -->
        <a class="logo" href="/index/frontData">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>仓储</b></span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>Depot仓储</b>管理系统</span>
        </a>


        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <a class="sidebar-toggle" data-toggle="offcanvas" href="#" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>

            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- User Account: style can be found in dropdown.less -->
                    <li class="dropdown user user-menu">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <img alt="User Image" class="user-image" src="../static/img/user2-160x160.jpg">
                            <span class="hidden-xs" th:text="${session.user.username}">用户名</span>
                        </a>
                        <ul class="dropdown-menu">
                            <!-- User image -->
                            <li class="user-header">
                                <img alt="User Image" class="img-circle" src="../static/img/user2-160x160.jpg">

                                <p th:text="${session.user.username}">用户名</p>
                                <div style="color:#ffffff"><small>登陆时间：</small> <small th:text="${session.loginTime}">登陆时间</small>
                                </div>

                            </li>
                            <!-- Menu Body
                    <li class="user-body">
                        <div class="row">
                            <div class="col-xs-4 text-center">
                                <a href="#">Followers</a>
                            </div>
                            <div class="col-xs-4 text-center">
                                <a href="#">Sales</a>
                            </div>
                            <div class="col-xs-4 text-center">
                                <a href="#">Friends</a>
                            </div>
                        </div>
                    </li>-->
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                <div class="pull-left">
                                    <a class="btn btn-default btn-flat" href="/user/changePasswordPage">修改密码</a>
                                </div>
                                <div class="pull-right">
                                    <a class="btn btn-default btn-flat" href="/user/logout">注销</a>
                                </div>
                            </li>
                        </ul>
                    </li>

                </ul>
            </div>
        </nav>
    </header>
    <!-- 页面头部 /-->

    <!-- 导航侧栏 -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- Sidebar user panel -->
            <div class="user-panel">
                <div class="pull-left image">
                    <img alt="User Image" class="img-circle" src="../static/img/user2-160x160.jpg">
                </div>
                <div class="pull-left info">
                    <p th:text="${session.user.username}">用户名</p>
                    <a href="#"><i class="fa fa-circle text-success"
                                   th:text="'实例：'+${session.user.instanceId}+'&nbsp;&nbsp;'"></i>已登录</a>
                </div>
            </div>
            <!-- search form -->
            <!--<form action="#" method="get" class="sidebar-form">
        <div class="input-group">
            <input type="text" name="q" class="form-control" placeholder="搜索...">
            <span class="input-group-btn">
            <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
            </button>
          </span>
        </div>
    </form>-->
            <!-- /.search form -->


            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu">
                <li class="header">菜单</li>

                <li id="admin-index"><a href="/index/frontData"><i class="fa fa-dashboard"></i> <span>首页</span></a>
                </li>

                <!-- 菜单 -->


                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-archive"></i> <span>商品管理</span>
                        <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                    <ul class="treeview-menu">

                        <li id="product-data">
                            <a href="/product/productData">
                                <i class="fa fa-circle-o"></i> 商品详情
                            </a>
                        </li>

                        <li id="product-add">
                            <a href="/product/addProductPage">
                                <i class="fa fa-circle-o"></i> 添加商品
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-calendar-minus-o"></i> <span>订单管理</span>
                        <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                    <ul class="treeview-menu">

                        <li id="order-data">
                            <a href="/order/orderData">
                                <i class="fa fa-circle-o"></i> 订单详情
                            </a>
                        </li>

                        <li id="order-add">
                            <a href="/order/addOrderPage">
                                <i class="fa fa-circle-o"></i> 添加订单
                            </a>
                        </li>

                        <li id="order-pending">
                            <a href="/order/pendingOrderPage">
                                <i class="fa fa-circle-o"></i> 待处理订单
                            </a>
                        </li>

                        <li id="order-picking">
                            <a href="/order/myPickingOrderPage">
                                <i class="fa fa-circle-o"></i> 我的拣货中订单
                            </a>
                        </li>

                        <li id="order-wait-deliver">
                            <a href="/order/myWaitDeliverOrderPage">
                                <i class="fa fa-circle-o"></i> 我的待发货订单
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-university"></i> <span>货架管理</span>
                        <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                    <ul class="treeview-menu">

                        <li id="rack-data">
                            <a href="/rack/rackData">
                                <i class="fa fa-circle-o"></i> 货架详情
                            </a>
                        </li>

                        <li id="rack-add">
                            <a href="/rack/addRackPage">
                                <i class="fa fa-circle-o"></i> 添加货架
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-table"></i> <span>出入库记录管理</span>
                        <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                    <ul class="treeview-menu">

                        <li id="io-data">
                            <a href="/io/ioData">
                                <i class="fa fa-circle-o"></i> 出入库记录详情
                            </a>
                        </li>

                        <li id="io-add">
                            <a href="/io/addIoPage">
                                <i class="fa fa-circle-o"></i> 添加出入库记录
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-globe"></i> <span>供应商管理</span>
                        <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                    <ul class="treeview-menu">

                        <li id="vendors-data">
                            <a href="/vendors/vendorsData">
                                <i class="fa fa-circle-o"></i> 供应商详情
                            </a>
                        </li>

                        <li id="vendors-add">
                            <a href="/vendors/addVendorsPage">
                                <i class="fa fa-circle-o"></i> 添加供应商
                            </a>
                        </li>
                    </ul>
                </li>

                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-user"></i> <span>用户管理</span>
                        <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                    <ul class="treeview-menu">

                        <li id="user-data">
                            <a href="/user/userData">
                                <i class="fa fa-circle-o"></i> 用户详情
                            </a>
                        </li>

                        <li id="user-add">
                            <a href="/user/addUserPage">
                                <i class="fa fa-circle-o"></i> 添加用户
                            </a>
                        </li>
                    </ul>
                </li>

                <li id="analysis"><a href="/analysis/analysisPage"><i class="fa fa-pie-chart"></i> <span>数据分析</span></a>
                </li>


                <!-- 菜单 /-->

            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>
    <!-- 导航侧栏 /-->

    <!-- 内容区域 -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                数据分析
                <small>分析仓库数据</small>
            </h1>
            <ol class="breadcrumb">
                <li class="active"><a href="#"><i class="fa fa-pie-chart"></i> 数据分析</a></li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box box-primary">
                        <div class="box-header">
                            <h3 class="box-title">数据分析</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <div class="col-xs-5">
                                <label for="start-datetime">起始日期</label>
                                <div class="input-group date form_date" data-date-format="dd MM yyyy" data-link-format="yyyy-mm-dd" data-link-field="dtp_input1">
                                    <input type="text" class="form-control" placeholder="设置起始日期" id="start-datetime">
                                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                </div>
                            </div>

                            <div class="col-xs-5">
                                <label for="end-datetime">终止日期</label>
                                <div class="input-group date form_date" data-date-format="dd MM yyyy" data-link-format="yyyy-mm-dd" data-link-field="dtp_input2">
                                    <input type="text" class="form-control" placeholder="设置终止日期" id="end-datetime">
                                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                </div>
                            </div>
                        </div>

                        <div class="box-footer">
                            <div>
                                <button onclick="setDate()" class="btn btn-primary">确定</button>
                                <p class="alert alert-danger hidden" style="margin-top: 20px" id="message">message</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>




            <div class="row hidden" id="charts">
                <div class="col-xs-12">
                    <!-- LINE CHART -->
                    <div class="box box-info">
                        <div class="box-header with-border">
                            <h3 class="box-title">每日出入库的商品总数</h3>

                            <div class="box-tools pull-right">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="box-body">
                            <div class="chart" id="io-lineChartContainer">
                                <canvas id="io-lineChart" style="height:250px"></canvas>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->

                </div>
                <!-- /.col (LEFT) -->
                <div class="col-xs-12">
                    <!-- AREA CHART -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">每日新增的订单数量</h3>

                            <div class="box-tools pull-right">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="box-body">
                            <div class="chart" id="order-barChartContainer">
                                <canvas id="order-barChart" style="height:250px"></canvas>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </div>

                </div>
                <div class="col-xs-12">
                    <!-- LINE CHART -->
                    <!-- DONUT CHART -->
                    <div class="box box-danger">
                        <div class="box-header with-border">
                            <h3 class="box-title">起止日期间销售出去的各类商品数量占比（前8种）</h3>

                            <div class="box-tools pull-right">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="box-body">
                            <div id="product-pieChartContainer">
                                <div id="product-pieChart" style="height: 300px"></div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->

                </div>
                <!-- /.col (RIGHT) -->
            </div>
            <!-- /.row -->

        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
</div>

<script src="../static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="../static/plugins/jQueryUI/jquery-ui.min.js"></script>
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<script src="../static/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/plugins/raphael/raphael-min.js"></script>
<script src="../static/plugins/morris/morris.min.js"></script>
<script src="../static/plugins/sparkline/jquery.sparkline.min.js"></script>
<script src="../static/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="../static/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="../static/plugins/knob/jquery.knob.js"></script>
<script src="../static/plugins/daterangepicker/moment.min.js"></script>
<script src="../static/plugins/daterangepicker/daterangepicker.js"></script>
<script src="../static/plugins/daterangepicker/daterangepicker.zh-CN.js"></script>
<script src="../static/plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="../static/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script src="../static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script src="../static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="../static/plugins/fastclick/fastclick.js"></script>
<script src="../static/plugins/iCheck/icheck.min.js"></script>
<script src="../static/plugins/adminLTE/js/app.min.js"></script>
<script src="../static/plugins/treeTable/jquery.treetable.js"></script>
<script src="../static/plugins/select2/select2.full.min.js"></script>
<script src="../static/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<script src="../static/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js"></script>
<script src="../static/plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script>
<script src="../static/plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js"></script>
<script src="../static/plugins/bootstrap-markdown/js/markdown.js"></script>
<script src="../static/plugins/bootstrap-markdown/js/to-markdown.js"></script>
<script src="../static/plugins/ckeditor/ckeditor.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<script src="../static/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="../static/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script src="../static/plugins/chartjs/Chart.min.js"></script>
<script src="../static/plugins/flot/jquery.flot.min.js"></script>
<script src="../static/plugins/flot/jquery.flot.resize.min.js"></script>
<script src="../static/plugins/flot/jquery.flot.pie.min.js"></script>
<script src="../static/plugins/flot/jquery.flot.categories.min.js"></script>
<script src="../static/plugins/ionslider/ion.rangeSlider.min.js"></script>
<script src="../static/plugins/bootstrap-slider/bootstrap-slider.js"></script>
<script src="../static/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.js"></script>
<script src="../static/plugins/bootstrap-datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script charset="UTF-8" src="../static/plugins/video/pingzi_video.js" type="text/javascript"></script>
<script>
    $(document).ready(function () {
        // 选择框
        $(".select2").select2();

        // WYSIHTML5编辑器
        $(".textarea").wysihtml5({
            locale: 'zh-CN'
        });
    });


    // 设置激活菜单
    function setSidebarActive(tagUri) {
        var liObj = $("#" + tagUri);
        if (liObj.length > 0) {
            liObj.parent().parent().addClass("active");
            liObj.addClass("active");
        }
    }
</script>
<script>
    let message = document.getElementById("message");

    var labelsList = [];
    var inData = [];
    var outData = [];
    var orderIncreaseData = [];
    var pieValueList = [];
    var pieLabelList = [];
    var pieData = [];

    function setDate() {
        let startTime = document.getElementById("start-datetime");
        let endTime = document.getElementById("end-datetime");
        if(startTime.value===""||endTime.value===""){
            message.innerText = "起始日期、终止日期不能为空！";
            message.setAttribute("class", "alert alert-danger");
        }else {
            $.ajax({
                url: "/analysis/getData",
                type: "post",
                data: {
                    "startTime": startTime.value,
                    "endTime": endTime.value
                },
                success: function (msg) {
                    if (msg['status'] === 200) {
                        labelsList = msg['data']['dateList'];
                        inData = msg['data']['inData'];
                        outData = msg['data']['outData'];
                        orderIncreaseData = msg['data']['orderIncreaseData'];
                        pieValueList = msg['data']['pieValueList'];
                        pieLabelList = msg['data']['pieLabelList'];
                        pieData = [
                            {
                                value: pieValueList[0],
                                color: "#f56954",
                                label: pieLabelList[0]
                            },
                            {
                                value: pieValueList[1],
                                color: "#00a65a",
                                label: pieLabelList[1]
                            },
                            {
                                value: pieValueList[2],
                                color: "#f39c12",
                                label: pieLabelList[2]
                            },
                            {
                                value: pieValueList[3],
                                color: "#00c0ef",
                                label: pieLabelList[3]
                            },
                            {
                                value: pieValueList[4],
                                color: "#3c8dbc",
                                label: pieLabelList[4]
                            },
                            {
                                value: pieValueList[5],
                                color: "#d2d6de",
                                label: pieLabelList[5]
                            },
                            {
                                value: pieValueList[6],
                                color: "#bf68ea",
                                label: pieLabelList[6]
                            },
                            {
                                value: pieValueList[7],
                                color: "#f3d309",
                                label: pieLabelList[7]
                            }
                        ];
                        setCharts();
                        message.setAttribute("class", "alert alert-danger hidden");
                    } else {
                        message.innerText = msg['error'];
                        message.setAttribute("class", "alert alert-danger");
                    }
                }
            });
        }
    }

    function setCharts() {
        $("#charts").attr("class","row");
        $("#io-lineChart").remove();
        $("#order-barChart").remove();
        $("#product-pieChart").remove();
        $("#io-lineChartContainer").append("<canvas id=\"io-lineChart\" style=\"height:250px\"></canvas>");
        $("#order-barChartContainer").append("<canvas id=\"order-barChart\" style=\"height:250px\"></canvas>");
        $("#product-pieChartContainer").append("<div id=\"product-pieChart\" style=\"height: 300px\"></div>");

        var lineChartData = {
            labels: labelsList,
            datasets: [
                {
                    label: "入库商品总数",
                    fillColor: "rgba(210, 214, 222, 1)",
                    strokeColor: "rgba(210, 214, 222, 1)",
                    pointColor: "rgba(210, 214, 222, 1)",
                    pointStrokeColor: "#c1c7d1",
                    pointHighlightFill: "#fff",
                    pointHighlightStroke: "rgba(220,220,220,1)",
                    data: inData
                },
                {
                    label: "出库商品总数",
                    fillColor: "rgba(60,141,188,0.9)",
                    strokeColor: "rgba(60,141,188,0.8)",
                    pointColor: "#3b8bba",
                    pointStrokeColor: "rgba(60,141,188,1)",
                    pointHighlightFill: "#fff",
                    pointHighlightStroke: "rgba(60,141,188,1)",
                    data: outData
                }
            ]
        };

        var barChartData = {
            labels: labelsList,
            datasets: [
                {
                    label: "新增订单",
                    fillColor: "rgb(110,148,222)",
                    strokeColor: "rgba(210, 214, 222, 1)",
                    pointColor: "rgba(210, 214, 222, 1)",
                    pointStrokeColor: "#c1c7d1",
                    pointHighlightFill: "#fff",
                    pointHighlightStroke: "rgba(220,220,220,1)",
                    data: orderIncreaseData
                },
            ]
        };

        var chartOptions = {
            //Boolean - If we should show the scale at all
            showScale: true,
            //Boolean - Whether grid lines are shown across the chart
            scaleShowGridLines: false,
            //String - Colour of the grid lines
            scaleGridLineColor: "rgba(0,0,0,0.05)",
            //Number - Width of the grid lines
            scaleGridLineWidth: 1,
            //Boolean - Whether to show horizontal lines (except X axis)
            scaleShowHorizontalLines: true,
            //Boolean - Whether to show vertical lines (except Y axis)
            scaleShowVerticalLines: true,
            //Boolean - Whether the line is curved between points
            bezierCurve: true,
            //Number - Tension of the bezier curve between points
            bezierCurveTension: 0.3,
            //Boolean - Whether to show a dot for each point
            pointDot: true,
            //Number - Radius of each point dot in pixels
            pointDotRadius: 4,
            //Number - Pixel width of point dot stroke
            pointDotStrokeWidth: 1,
            //Number - amount extra to add to the radius to cater for hit detection outside the drawn point
            pointHitDetectionRadius: 20,
            //Boolean - Whether to show a stroke for datasets
            datasetStroke: true,
            //Number - Pixel width of dataset stroke
            datasetStrokeWidth: 2,
            //Boolean - Whether to fill the dataset with a color
            datasetFill: true,
            //String - A legend template
            legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].lineColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
            //Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
            maintainAspectRatio: true,
            //Boolean - whether to make the chart responsive to window resizing
            responsive: true
        };


        //-------------
        //- LINE CHART -
        //--------------
        var lineChartCanvas = $("#io-lineChart").get(0).getContext("2d");
        var lineChart = new Chart(lineChartCanvas);
        chartOptions.datasetFill = false;
        lineChart.Line(lineChartData, chartOptions);


        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#order-barChart").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        barChartData.datasets[0].fillColor = "#00a65a";
        barChartData.datasets[0].strokeColor = "#00a65a";
        barChartData.datasets[0].pointColor = "#00a65a";
        var barChartOptions = {
            //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
            scaleBeginAtZero: true,
            //Boolean - Whether grid lines are shown across the chart
            scaleShowGridLines: true,
            //String - Colour of the grid lines
            scaleGridLineColor: "rgba(0,0,0,.05)",
            //Number - Width of the grid lines
            scaleGridLineWidth: 1,
            //Boolean - Whether to show horizontal lines (except X axis)
            scaleShowHorizontalLines: true,
            //Boolean - Whether to show vertical lines (except Y axis)
            scaleShowVerticalLines: true,
            //Boolean - If there is a stroke on each bar
            barShowStroke: true,
            //Number - Pixel width of the bar stroke
            barStrokeWidth: 2,
            //Number - Spacing between each of the X value sets
            barValueSpacing: 5,
            //Number - Spacing between data sets within X values
            barDatasetSpacing: 1,
            //String - A legend template
            legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
            //Boolean - whether to make the chart responsive
            responsive: true,
            maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);


        //-------------
        //- PIE CHART -
        //-------------
        var donut = new Morris.Donut({
            element: 'product-pieChart',
            resize: true,
            data: pieData,
            hideHover: 'auto'
        });

    }

    $(document).ready(function () {
        // 激活导航位置
        setSidebarActive("analysis");
    });
</script>
<script>
    $('.form_date').datetimepicker({
        language : 'zh-CN',
        format : 'yyyy-mm-dd',
        weekStart: 1,
        todayBtn:  1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        forceParse: 0,
        minView: 2
    });
</script>
</body>

</html>